'use strict';

/**
 * @ngdoc directive
 * @name jgappApp.directive:emoji
 * @description
 * # emoji
 */
angular.module('jgappApp')
  .directive('emoji', function ($timeout) {
    return {
      scope: {
        picker: "=emojipicker"
      },
      template: '<div class="emoji-items grid tc">' +
      '<span class="col-1-7" ng-repeat="emoji in emojilist track by $index" ng-click="pickemoji(emoji)" ng-bind-html="emoji | colonToSmiley"></span>' +
      '</div>',
      restrict: 'AE',
      link: function postLink(scope, element, attrs) {
        scope.emojilist = [":unamused:",
          ":relaxed:", ":grin:",
          ":heart_eyes:", ":blush:",
          ":joy:", ":cold_sweat:",
          ":kissing_heart:", ":heart:",
          ":+1:", ":pensive:",
          ":smile:", ":sob:",
          ":kiss:", ":flushed:",
          ":stuck_out_tongue_winking_eye:",
          ":see_no_evil:", ":wink:",
          ":smiley:", ":cry:",
          ":stuck_out_tongue_closed_eyes:",
          ":scream:", ":rage:",
          ":smirk:", ":disappointed:",
          ":sweat_smile:", ":kissing_closed_eyes:",
          ":speak_no_evil:", ":relieved:",
          ":yum:", ":ok_hand:",
          ":neutral_face:"];
        scope.pickemoji = function (emoji) {
          scope.picker(emoji);
        };

      }

    };
  });
